#--------------------------------------------------------------------------------------------------------------------------------------------------------
#
# Mi-DevEnv			:	http://midevenv.codeplex.com 
#					:	(c) IT Bridge 2012
#					:	A concept originated by Chris Nurse
#
# Licence			:	GNU General Public License version 2 (GPLv2)
#					:	http://midevenv.codeplex.com/license
#
# Summary           :   Install SQL Server 2008
#
#--------------------------------------------------------------------------------------------------------------------------------------------------------

Set-StrictMode -Version Latest

if ((Get-Module MDE-Common) -eq $null) {
    Import-Module MDE-Common
    }

[string]$executionPath = Split-Path $script:MyInvocation.MyCommand.Path -Parent
[bool]$needDC = $true
[bool]$needWebServer = $true

Function InstallProduct() {
    
    if (Get-RunInstallation -Package GetPackageName -RequireDC $needDC -RequireIIS $needWebServer) {
        Add-ServiceAccounts -Product SQL
        & $InstallFolder\SQL2008\Setup.exe /ConfigurationFile="$executionPath\ResponseSQL2008.ini" /Q
        Wait-SetupComplete
        }
    }

#region Framework

Function GetInstallName() {
    return "Microsoft SQL Server 2008 (64-bit)"
    }
    
Function GetRequireRestart() {
    return $true
    }

Function GetPackageName() {
    return "SQL2008"
    }

Function GetPackageDescription() {
    return "SQL Server 2008 (All features except replication)"
    }
    
Function GetServerBuild() {
    return $false
    }
            
Function GetInstallPriority() {
    return 5000
    }

#endregion